package com.bt7274.annotation;

import java.lang.annotation.*;

/**
 * 定义注解用于标记特定方法，区别用户权限
 * @author galland
 */
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RequireLogin {

    /**
     * 验证角色
     * @return true if role check required, false otherwise
     */
    boolean checkRole() default false;

    /**
     * 定义访问接口所需的最低角色权限
     * 0 = normal user, 1 = moderator, 2 = admin
     * @return minimum role required
     */
    int role() default 0;
}